<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/11/12
 * Time: 17:25
 */

namespace app\common\service;


class IpsType
{
    /**
     * @name 自定义规则类型列表
     * @return array
     * @author wx
     * @date 2019/11/12 17:27
     */
    function freeRuleList()
    {
        return db('ips_type')->where('type', 'freeRule')->column('show_name','id');
    }

    /**
     * @name 网络类型列表
     * @return array
     * @author wx
     * @date 2019/11/12 17:27
     */
    function networkList()
    {
        return db('ips_type')->where('type', 'network')->column('show_name','id');
    }

    /**
     * @name 查询数据
     * @param $condition
     * @return array|null|\PDOStatement|string|\think\Model
     * @author wx
     * @date 2019/11/14 13:06
     */
    function findData($condition)
    {
        return db('ips_type')->where($condition)->find();
    }
}